﻿/* shipArmor.cs
 *  Author: Richard Broker
 *  
 *  This file is part of Tame.
 *
 *  Tame is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  
 *  Tame is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with Tame. If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Tame.ShipStructure
{   
    class shipArmor
    {
        int armorType = -1;
        int armorStrength = 0;
        int armorCost;
        int xpRequirement = 0;
        string rankRequirementPath = null;
        string equipmentImagePath = null;
        bool isPardus = false;

        public shipArmor()
        {
        }

        public void initialiseArmor(int aVal)
        {

        }

        public void initialiseArmor(int aType, int aStrength)
        {
            switch (aType)
            {
                case 0: // Conv
                    switch (aStrength)
                    {
                        case 1: armorType = aType; armorStrength = aStrength; armorCost = 6500; xpRequirement = 0; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_c1.png"); break;
                        case 2: armorType = aType; armorStrength = aStrength; armorCost = 56000; xpRequirement = 60; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_c2.png"); break;
                        case 3: armorType = aType; armorStrength = aStrength; armorCost = 290000; xpRequirement = 2400; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_c3.png"); break;
                        case 4: armorType = aType; armorStrength = aStrength; armorCost = 935000; xpRequirement = 8850; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_c4.png"); break;
                        case 5: armorType = aType; armorStrength = aStrength; armorCost = 2870000; xpRequirement = 28200; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_c5.png"); break;
                        case 6: armorType = aType; armorStrength = aStrength; armorCost = 2990000; xpRequirement = 0; isPardus = false; rankRequirementPath = Path.Combine("factions", "unirank9.png"); equipmentImagePath = Path.Combine("equipment", "armor_c6.png"); break;
                    }
                    break;
                case 1: // Organic
                    switch (aStrength)
                    {
                        case 1: armorType = aType; armorStrength = aStrength; armorCost = 190000; xpRequirement = 1400; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_o2.png"); break;
                        case 2: armorType = aType; armorStrength = aStrength; armorCost = 435000; xpRequirement = 3850; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_o3.png"); break;
                        case 3: armorType = aType; armorStrength = aStrength; armorCost = 1400000; xpRequirement = 12500; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_o4.png"); break;
                        case 4: armorType = aType; armorStrength = aStrength; armorCost = 4305000; xpRequirement = 42550; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_o5.png"); break;
                    }
                    break;
                case 2: // EM
                    switch (aStrength)
                    {
                        case 1: armorType = aType; armorStrength = aStrength; armorCost = 200000; xpRequirement = 1500; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_e2.png"); break;
                        case 2: armorType = aType; armorStrength = aStrength; armorCost = 464000; xpRequirement = 4140; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_e3.png"); break;
                        case 3: armorType = aType; armorStrength = aStrength; armorCost = 1560000; xpRequirement = 15100; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_e4.png"); break;
                        case 4: armorType = aType; armorStrength = aStrength; armorCost = 4856000; xpRequirement = 48060; isPardus = false; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_e5.png"); break;
                    }
                    break;
                case 3: // Pardus
                    switch (aStrength)
                    {
                        case 1: armorType = aType; armorStrength = aStrength; armorCost = 6500; xpRequirement = 0; isPardus = true; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_c1.png"); break;
                        case 2: armorType = aType; armorStrength = aStrength; armorCost = 56000; xpRequirement = 60; isPardus = true; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_c2.png"); break;
                        case 3: armorType = aType; armorStrength = aStrength; armorCost = 290000; xpRequirement = 2400; isPardus = true; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_c3.png"); break;
                        case 4: armorType = aType; armorStrength = aStrength; armorCost = 935000; xpRequirement = 8850; isPardus = true; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_c4.png"); break;
                        case 5: armorType = aType; armorStrength = aStrength; armorCost = 2870000; xpRequirement = 28200; isPardus = true; rankRequirementPath = null; equipmentImagePath = Path.Combine("equipment", "armor_c5.png"); break;
                        case 6: armorType = aType; armorStrength = aStrength; armorCost = 2990000; xpRequirement = 0; isPardus = true; rankRequirementPath = Path.Combine("factions", "unirank9.png"); equipmentImagePath = Path.Combine("equipment", "armor_c6.png"); break;
                    }
                    break;
                default: armorType = 0; armorStrength = 0; armorCost = 0; xpRequirement = 0; isPardus = false; rankRequirementPath = null; equipmentImagePath = null; break;
            }
        }

        public int getArmorType()
        {
            return armorType;
        }
        public int getArmorStrength()
        {
            return armorStrength;
        }
        public int getArmorCost()
        {
            return armorCost;
        }
        public int getXPRequirement()
        {
            return xpRequirement;
        }
        public bool isPardusArm()
        {
            return isPardus;
        }
        public string getRankPath()
        {
            return rankRequirementPath;
        }
        public string getEquipmentPath()
        {
            return equipmentImagePath;
        }
    }
}
